data = """
并发数        成功率             平均延迟(s)         TPS             token/s        
1          3/3             18.66           0.12          27.93
5          3/3             26.47            0.1          30.93
10         3/3             19.66           0.11          24.89
"""

def convert_to_md_table(data):
    # 分割数据行
    lines = [line.strip() for line in data.strip().splitlines()]
    
    # 提取表头和内容
    headers = [h.strip() for h in lines[0].split() if h]
    rows = []
    for line in lines[1:]:
        # # 处理成功率的分数字段
        # if '/' in line:
        #     print(line)
        #     line = line.replace(' ', '/', 1)
        #     print(line)
        rows.append([val.strip() for val in line.split() if val])
    
    # 构建表格输出
    table = []
    
    # 表头行
    table.append(f"| {' | '.join(headers)} |")
    
    # 分隔线
    table.append(f"|{'|'.join([' ------ '] * len(headers))}|")
    
    # 数据行
    for row in rows:
        table.append(f"| {' | '.join(row)} |")
    
    return "\n".join(table)

# 执行转换并输出
markdown_table = convert_to_md_table(data)
print(markdown_table)